[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
##############################################################################
###+----------+###############################################################
#+-| SUBSTR() |--------------------------------------+########################
#| +----------+ Returns a substring of source_string |########################
#+---------------------------------------------------+########################
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#|     #INCLUDE string.hdr     |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------------+##########################
#|     FUNCTION CHAR substr PROTOTYPE              |##########################
#|      PARAMETERS CONST CHAR source_string, ;     |##########################
#|      VALUE UINT start_position, ;               |##########################
#|      VALUE UINT length                          |##########################
#+-------------------------------------------------+##########################
##############################################################################
##############################################################################
########+---| Description |------------------------------------------+########
########| The substr() function returns a substring of source_string |########
########| starting at the start_position for length characters.      |########
########| ---------------------------------------------------------- |########
########| The substr() function is 1 based.  That is, the 1st        |########
########| character in source_string starts at position 1.           |########
########+------------------------------------------------------------+########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########|                                                          |#########
#########| ? substr("FORCE compiler",1,5)   && Prints "FORCE"       |#########
#########|                                                          |#########
#########| STORE 4 TO a,b                                           |#########
#########| STORE "A sample string to " TO sample                    |#########
#########| ? substr( sample, a, b )         && Prints "ampl"        |#########
#########|                                                          |#########
#########| ? substr( any_string, 1, len( any_string )               |#########
#########|                                                          |#########
#########| *--- prints: contents of any_string                      |#########
#########+----------------------------------------------------------+#########
##############################################################################

See Also: at() stuff()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson